/**
 * 
 */
package com.wolfpire.info.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wolfpire.info.dao.TrainingCountInfoDao;
import com.wolfpire.info.model.TrainingCountInfo;
import com.wolfpire.info.service.TrainingCountInfoService;
import com.wolfpire.system.common.Constants;
import com.wolfpire.system.common.Page;
import com.wolfpire.system.common.base.dao.IBaseHibernateDao;
import com.wolfpire.system.common.base.service.impl.BaseHibernateService;

/**
 * @author lihd
 *
 */

@Service("rainingCountInfoService")
public class TrainingCountInfoServiceImpl extends
		BaseHibernateService<TrainingCountInfo, Long> implements
		TrainingCountInfoService {

	@Override
	public List<TrainingCountInfo> list(TrainingCountInfo trainingCountInfo) {
		return this.trainingCountInfoDao.list(trainingCountInfo);
	}

	@Override
	public void del(Long id) {
		// TODO Auto-generated method stub
		TrainingCountInfo trainingCountInfo = this.trainingCountInfoDao.get(id);
		if (null != trainingCountInfo) {
			trainingCountInfo.setDelFlag(Constants.DELETE_FLAG);
			this.trainingCountInfoDao.saveOrUpdate(trainingCountInfo);
		}
	}

	@Override
	public Page<TrainingCountInfo> setPageDataList(
			Page<TrainingCountInfo> page,
			TrainingCountInfo filterTrainingCountInfo) {
		return this.trainingCountInfoDao.findTrainingCountInfos(page, filterTrainingCountInfo);
	}

	@Override
	protected IBaseHibernateDao<TrainingCountInfo, Long> getEntityDao() {
		return this.trainingCountInfoDao;
	}
	
	@Resource private TrainingCountInfoDao trainingCountInfoDao;
}
